<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="umsroot.css">
<TITLE>
Stack Overflows
</TITLE>
</HEAD>
<BODY >
<A HREF="umsroot148.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot147.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot150.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc330">C.2</A>&nbsp;&nbsp;Stack Overflows</H2>
<A NAME="@default1214"></A>
<A NAME="@default1215"></A>
When a stack overflows, the system performs an
<A HREF="../bips/kernel/control/exit_block-1.html"><B>exit_block/1</B></A><A NAME="@default1216"></A>
with an appropriate exit tag, ie.
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>global_trail_overflow</B><DD CLASS="dd-description"> for overflows of the global/trail stack
	that holds all the program's data structures.
<DT CLASS="dt-description"><B>local_control_overflow</B><DD CLASS="dd-description"> for overflows of the local/control stack
	that holds information related to the control flow.
</DL>
These exits can be caught by wrapping a goal that is likely
to overflow the stacks into an appropriate
<A HREF="../bips/kernel/control/block-3.html"><B>block/3</B></A><A NAME="@default1217"></A>, e.g.
<BLOCKQUOTE CLASS="quote"><PRE CLASS="verbatim">
..., block(big_goal(X), global_trail_overflow, react_to_overflow), ...
</PRE></BLOCKQUOTE>
In the debugger, you can locate the overflow by jumping to a LEAVE port
(z command).
See chapter <A HREF="umsroot121.html#chapmemory">19</A> for more details on memory usage.<BR>
<BR>
<HR>
<A HREF="umsroot148.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="umsroot147.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="umsroot150.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
